home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 1125 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.4 KB

  1. From: jpotter@falcon.lhup.edu (John E. Potter)
  2. Message-ID: <4l2k94$79m@jake.esu.edu>
  3. X-Original-Date: 17 Apr 1996 11:22:12 GMT
  4. Path: in1.uu.net!bounce-back
  5. Date: 17 Apr 96 13:14:41 GMT
  6. Approved: fjh@cs.mu.oz.au
  7. Newsgroups: comp.std.c++
  8. Subject: Re: Interpretation Sought for DWP Concept of 'Valid Object'
  9. Organization: East Stroudsburg University, Pennsylvania
  10. References: <4kltuk$73j@bmtlh10.bnr.ca> <xso7mviv2g6.fsf@avs.cs.rpi.edu>
  11. X-Newsreader: TIN [version 1.2 PL2]
  12. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  13.     iQBFAgUBMXTuyuEDnX0m9pzZAQGq4wGAjdzrx42YUuTWd+F9qGitWyUT32L+MzMB
  14.     Pshf8q5EadhtrvrXXUKxDyyoaoB+oEfu
  15.     =2cfe
  16.  
  17. David Vandevoorde (vandevod@cs.rpi.edu) wrote:
  18. : >>>>> "JH" == "john (j d ) hickin" <hickin@bnr.ca> writes:
  19. : [...]
  20. : JH> A recent thread in another newsgroup has aroused some interest.
  21. : JH> Lately there has been a small debate around the interpretation of
  22. : JH> the following phrase, ostensibly taken from the DWP:
  23.  
  24. : JH>     A reference shall be initialized to refer to a valid object or
  25. : JH>     function.
  26.  
  27. : I checked and could find no such wording. Instead, I found:
  28.  
  29. :   [dcl.init.ref] 8.5.3/1
  30. :   A  variable  declared  to  be  a  T&,  that  is
  31. :   "reference to type T"
  32. :   (_dcl.ref_), shall be initialized by an object, or function,
  33. :   of type T
  34. :   or by an object that can be converted into a T.
  35.  
  36. : JH> One party claims that valid object means initialized object while
  37. : JH> another claims that all is required is that the object have a
  38. : JH> valid address.
  39.  
  40. : JH> Does the DWP make it clear which interpretation should be used?
  41.  
  42. : I'm not at all sure that the DWP uses the phrase `valid object' at
  43. : all. If it did, I would expect it to mean `an object whose lifetime
  44. : has begun and not expired'; the lifetime of an object is defined in
  45. : [basic.life].
  46.  
  47. From April public draft.
  48.  
  49. 8.3.2 [dcl.ref] /4
  50.  
  51. "A reference shall be initialized to refer to a valid object or
  52.                                                 ^^^^^
  53. function.  In particular, null references are prohibited; ..."
  54.  
  55. IMHO it is a verbose lead-in to the next sentence which really says
  56. something.
  57.  
  58. John
  59. ---
  60. [ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
  61. [ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
  62. [ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
  63. [ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
  64. [ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
  65.